package com.xjoyt.pay.commons;

import java.util.LinkedHashMap;
import java.util.Map;

import com.xjoyt.pay.vo.MoneyType;

public final class MoneyTypeUtils {

	private static Map<MoneyType, String> moneyMap = null;

	static {
		moneyMap = new LinkedHashMap<>();
		moneyMap.put(MoneyType.TRADE, "交易");
		moneyMap.put(MoneyType.TRADE_BACK, "交易退款");
		moneyMap.put(MoneyType.TRADE_POUNDAGE_ADD, "扣除交易手续费");
		moneyMap.put(MoneyType.TRADE_POUNDAGE_REMOVE, "退回交易手续费");
		moneyMap.put(MoneyType.PAY, "代付");
		moneyMap.put(MoneyType.PAY_BACK, "代付退款");
		moneyMap.put(MoneyType.PAY_POUNDAGE_ADD, "扣除代付手续费");
		moneyMap.put(MoneyType.PAY_POUNDAGE_REMOVE, "退回代付手续费");
		moneyMap.put(MoneyType.CASH, "提现");
		moneyMap.put(MoneyType.CASH_POUNDAGE, "提现手续费");
	}

	public static Map<MoneyType, String> getAllMoneyType() {
		return moneyMap;
	}

	public static String getName(MoneyType type) {
		if (type == null) {
			return null;
		}
		return moneyMap.containsKey(type) ? moneyMap.get(type) : null;
	}

}
